package de.mhus.lib.mandala.list;

import de.mhus.lib.mandala.Component;
import de.mhus.lib.mandala.Response;
import de.mhus.lib.mandala.functions.FunctionCall;


public class SelectableList extends Component {

	private ListItem item;
	private FunctionCall selectAction = null;

	@Override
	public void doRender(Response response) {
		item.checkSelectableAction();
		
		response.startTag("div", "list-group" , this.getTagAttributes());
		
		response.startTag("a", "list-group-item", item.getTagAttributes(), "href","#");
		item.doRender(this,response);
		response.endTag("a");
		
		response.endTag("div");

	}

	public ListItem getItem() {
		return item;
	}

	public ListItem setItem(ListItem item) {
		this.item = item;
		return item;
	}

	public FunctionCall getSelectAction() {
		return selectAction;
	}

	public void setSelectAction(FunctionCall selectAction) {
		this.selectAction = selectAction;
	}

	
}
